package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.Constant;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by Administrator on 2017/10/11.
 */

public class SendForumCommentApi extends BaseApi {
    ForumCommentReq req;




    public SendForumCommentApi(String member_id, String post_id, String reply_details, String reply_annex,String reply_voice,String voice_long) {
        req = new ForumCommentReq(member_id, post_id,reply_details,reply_annex,reply_voice,voice_long);
    }


    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).ForumReplyList(requestBody);
    }

    private class ForumCommentReq {
        public String member_id;//用户id
        public String post_id;//帖子id
        public String reply_details;//回复详情
        public String reply_annex;//图片地址
        public String reply_voice;//图片地址
        public String client_id;//升级type
        public String jpush_test;//安卓默认传1
        public String voice_long;//安卓默认传1

        public ForumCommentReq(String member_id, String post_id, String reply_details, String reply_annex ,String reply_voice,String voice_long) {
            super();
            this.member_id = member_id;
            this.post_id = post_id;
            this.reply_details = reply_details;
            this.reply_annex = reply_annex;
            this.reply_voice=reply_voice;
            this.voice_long=voice_long;
            this.client_id= Constant.CLIENT_TYPE;
            this.jpush_test="1";
        }
    }
}